<?php

function showModuleWrapBegin($module_class,$module_width,$module_height,$floatflag,$margin) {
	$style_width = ($module_width) ? $module_width : "auto";
	$style_height = ($module_height) ? $module_height : "auto";
	$style_float = ($floatflag) ? $floatflag : "none";
	$style_margin = ($margin) ?  $margin : "0";
	$module_clear = ($style_float == "none") ? "clear:both;" : "";
	$module_style=" style=\"width:".$style_width.";height:".$style_height.";float:".$style_float.";margin-right:".$style_margin.";".$module_clear."\"";
	echo "<div class=\"".$module_class."\"".$module_style.">\n<div class=\"module-top\"><div class=\"inner\"></div></div>\n<div class=\"module-middle\"><div class=\"inner\"><div class=\"module-content\">\n";
}
function showModuleWrapEnd() {
	echo "</div></div></div>\n<div class=\"module-bottom\"><div class=\"inner\"></div></div></div>\n\n";
}


function showModule($module_title,$module_style,$module_extclass,$module_type,$module_wrap,$module_content) {
	if ($module_style) { $module_sclass = " module_" . $module_style; } else { $module_sclass = " module_simple"; }
	if ($module_type) { $module_type = " module_" . $module_type; }
	if ($module_extclass) { $module_extclass = " " . $module_extclass; }
	if ($module_wrap) { $module_content = str_replace("#C#", $module_content, $module_wrap); }
	$module_class = "module".$module_sclass.$module_type.$module_extclass;
	if ($module_style == "s1" || $module_style == "s2") {
		$module_show = "<div class=\"".$module_class."\">\n<div class=\"module-top\"><div class=\"inner\"></div></div>\n<div class=\"module-middle\"><div class=\"inner\">\n";
		$module_show = $module_show . "<h3>".$module_title."</h3>";
		$module_show = $module_show . "<div class=\"module-content\">".$module_content."</div>";
		$module_show = $module_show . "\n</div></div>\n<div class=\"module-bottom\"><div class=\"inner\"></div></div>\n</div>\n\n";
	} else {
		$module_show = "<div class=\"".$module_class."\">\n<h3>".$module_title."</h3>\n<div class=\"module-content\">".$module_content."</div>\n</div>\n\n";
	}
	echo $module_show;
}
class Module {
	private $module_header;
	private $module_footer;
	private $module_title;
	private $module_content;
	private $module_class;
	private $module_type;
	private $module_display;

	private function genModule() {
		$this->module_display = "模组开始<br />".$module_content."<br />模组结束";
	}

	public function setVar($varname,$value) {
		$this->$varname=$value;
	}

	public function printModule() {
		$this->genModule();
		echo $this->module_display;
	}
}

?>